//
//  PresentingViewController.m
//  CustomModalTransition
//
//  Created by 朱志佳 on 2019/4/4.
//  Copyright © 2019 朱志佳. All rights reserved.
//

#import "PresentingViewController.h"
#import "SLModalTransitionDelegate.h"
#import "PresentedViewController.h"

@interface PresentingViewController ()

@property (nonatomic,strong) SLModalTransitionDelegate *presentTransitionDelegate;

@end

@implementation PresentingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
}

/*
 .FullScreen 的时候，presentingView 的移除和添加由 UIKit 负责，在 presentation 转场结束后被移除，dismissal 转场结束时重新回到原来的位置；
 .Custom 的时候，presentingView 依然由 UIKit 负责，但 presentation 转场结束后不会被移除。
 */

 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
     NSLog(@"%@##%@",NSStringFromClass([self class]),NSStringFromSelector(_cmd));
     PresentedViewController *toVC = [segue destinationViewController];
     self.presentTransitionDelegate = [SLModalTransitionDelegate new];
     toVC.transitioningDelegate = self.presentTransitionDelegate;
     toVC.modalPresentationStyle = UIModalPresentationCustom;
     
     [super prepareForSegue:segue sender:sender];
 }


@end
